﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Text;

namespace Grade
{
    public partial class WebForm5 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btndt_Click(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder(1024);
            sb.Append("DELETE FROM Student WHERE   (No = @No) ");
            SqlParameter[] pms = new SqlParameter[1];
            pms[0] = new SqlParameter("@No", this.txtno0.Text);
            int intResult = SqlHelper.ExecuteNonQuery(sb.ToString(), pms);
            this.lbl2.Text = (intResult < 1) ? "删除失败！" : "删除了";
        }

        protected void btndt0_Click(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder(1024);
            sb.Append("DELETE FROM Student WHERE   (Name = @Name) ");
            SqlParameter[] pms = new SqlParameter[1];
            pms[0] = new SqlParameter("@Name", this.txtname0.Text);
            int intResult = SqlHelper.ExecuteNonQuery(sb.ToString(), pms);
            this.lbl2.Text = (intResult < 1) ? "删除失败！" : "删除了";
        }
    }
}